<tagLib name="html"/>
<include file="./Index/Tpl/Home/default/public/header.htm" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/inn-adm-base.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/jsLibrary/uploadify/uploadify.css" />
<script src="__PUBLIC__/jsLibrary/uploadify/jquery.uploadify-3.1.min.js"></script>
<script type='text/javascript'>
function del(id) {
    if(confirm('确定要删除此图片？')) {
        $.post('__KZURL__/innAdm/delimages', { "id": <{$inn["id"]}>, "imgid":id },
            function(data){
                if(data!=1)
                    alert(data);
                else
                    $('#innimages'+id).remove();
            }, "text");
    }
}
$(function() {
    $("#images_upload").uploadify({
        swf      : '__PUBLIC__/jsLibrary/uploadify/uploadify.swf',
        uploader : '__KZURL__/innAdm/upimages',
        height   : 30,
        width    : 120,
        buttonText: '选择图片',
        fileTypeExts: '*.gif;*.jpg;*.jpeg;*.png',
        fileSizeLimit: '1024KB',
        formData: {
            "id":"<{$inn.id}>"
        },
        onUploadSuccess: function (file, data, response) {
            if (data.indexOf('错误提示：') > -1) {
                alert(data);
            } else {
                data    = eval('(' + data + ')');
                domStr  = "<span id='innimages"+data.picid+"'>";
                domStr += "  <em class='del'>";
                domStr += "    <a href='javascript:;'>";
                domStr += "      <img src='__PUBLIC__/images/sc.png' onclick='del("+data.picid+")' />";
                domStr += "    </a>";
                domStr += "  </em>";
                domStr += "  <em>";
                domStr += "    <img src='"+data.picpath+"' width='100' />";
                domStr += "  </em>";
                domStr += "</span>";
                $("li.tpj").append(domStr);
            }
        },
        onUploadError: function (file, errorCode, errorMsg, errorString) {
            alert('文件：' + file.name + ' 上传失败: ' + errorString);
        }
    });
});
</script>
<div class="content">
    <include file="public:innleft" />
    <!--商家后台右边 start-->
    <div class="sjht_right">
        <!--会员资料 start-->
        <div class="hyzl">
            <li><a href='__KZURL__/innAdm/index-id-<{$inn.id}>'>会员资料</a></li>
            <li><a href='__KZURL__/innAdm/base-id-<{$inn.id}>'>客栈基本信息</a></li>
            <li><a href='__KZURL__/innAdm/details-id-<{$inn.id}>'>客栈详情</a></li>
            <li class="hyzl_hover"><a href='__KZURL__/innAdm/images-id-<{$inn.id}>'>客栈图集</a></li>
            <li><a href='__KZURL__/innAdm/other-id-<{$inn.id}>'>其它信息</a></li>
        </div>
        <!--会员资料 end-->
        <!--具体信息 start-->
        <div class="sjht_xx">
            <!--具体信息左边 start-->
            <div class="sjht_fd">
                <ul>
                    <li class="jt_title">客栈图集</li>
                    <li class="sjht_jtxx">
                        <p class="zc_xx">
                            <span class="zc_xx_title">客栈图集</span>
                            <span><input type="file" name='images_upload' id='images_upload' /></span>
                        </p>
                    </li>
                    <li class="tpj">
                        <volist name='InnImagesList' id='vo'>
                        <span id='innimages<{$vo.id}>'>
                            <em class="del"><a href='javascript:;'><img src="__PUBLIC__/images/sc.png" onclick='del(<{$vo.id}>)' /></a></em>
                            <em><img src="<{$vo.path}>" width="100" /></em>
                        </span>
                        </volist>
                    </li>
                </ul>
            </div>
            <!--具体信息左边 end-->
        </div>
        <!--具体信息 end-->
    </div>
</div>
<include file="./Index/Tpl/Home/default/public/footer.htm" />